import java.util.concurrent.locks.LockSupport;
public class LockSupportDemo1 {
    public static void main(String[] args) throws InterruptedException {
        // 线程1：LockSupport 休眠 park
        Thread t1 = new Thread(() -> {
            System.out.println("线程1：开始执行");
            LockSupport.park();
            System.out.println("线程1：结束执行");
        }, "线程1");
        t1.start();


        Thread t2 = new Thread(() -> {
            System.out.println("线程2：开始执行");
            LockSupport.park();
            System.out.println("线程2：结束执行");
        }, "线程2");
        t2.start();

        Thread t3 = new Thread(() -> {
            System.out.println("线程3：开始执行");
            LockSupport.park();
            System.out.println("线程3：结束执行");
        }, "线程3");
        t3.start();

        Thread.sleep(1000);
        System.out.println();
        LockSupport.unpark(t1);

        Thread.sleep(1000);
        LockSupport.unpark(t2);

        Thread.sleep(1000);
        LockSupport.unpark(t3);

    }
}